<template>
  <template v-if="!menu.children">
    <el-menu-item :index="menu.path">
      {{ menu.name }}
    </el-menu-item>
  </template>
  <template v-else>
    <el-sub-menu :index="menu.path">
      <template #title>
        <span>{{ menu.name }}</span>
      </template>
      <div v-for="child in menu.children">
        <MenuTree :key="child.path" :menu="child" />
      </div>
    </el-sub-menu>
  </template>
</template>

<script setup lang="ts">
defineProps<{ menu: NMenu.IMenu }>()
</script>

<style scoped></style>
